import { QueryClient, QueryClientProvider } from '@tanstack/react-query'
import type { ReactNode } from 'react'

const queryClient = new QueryClient({
    defaultOptions:{
        queries:{
            retry:false
        }
    }
})

export default function useAppQuery() {
  const AppQueryProvider = ({ children }: { children: ReactNode }) => {
    return (
      <QueryClientProvider client={queryClient}>
        {children}
      </QueryClientProvider>
    )
  }
  return {
    AppQueryProvider,
  }
}
